package homework;

public class qiuhejiejin {
	public static void main(String[] args) {
		int i=0;
		int sum=0;
		while(i<=100)
		{
			sum = sum+i;
		    i++;
		}
	if(sum-10000<10000-(sum-i))
		System.out.println(i);
	else
		System.out.println(i-1);
		System.out.println(sum);
	}
}
